/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package views.utilitario;

/**
 *
 * @author Wenderson
 */
public class LigacaoAtributo extends AbstractTabelaDinamica {
    private int cdAux;
    private int cdDim;
    private String nomeAux;
    private String nomeDim;
    private boolean trans;
    
    public LigacaoAtributo() {};
    
    public LigacaoAtributo(int cdAux, int cdDim, String nomeAux, String nomeDim, boolean trans) {
        this.cdAux = cdAux;
        this.cdDim = cdDim;
        this.nomeAux = nomeAux;
        this.nomeDim = nomeDim;
        this.trans = trans;
    }

    @Override
    public String[] getColumns() {
        return new String[] {"Atr. Aux", "Atr. Dim", "Trans."};
    }

    @Override
    public Class getClass(int index) {
        switch (index) {
            case 0:
            case 1: return String.class;
            case 2: return Boolean.class;
            default: return Object.class;
        }
    }

    @Override
    public Object getValue(int index) {
        switch (index) {
            case 0: return this.nomeAux;
            case 1: return this.nomeDim;
            case 2: return this.trans;
            default: return null;
        }
    }

    @Override
    public void setValue(int index, Object value) {
        switch (index) {
            case 0: this.nomeAux = (String) value; break;
            case 1: this.nomeDim = (String) value; break;
            case 2: this.trans = (Boolean) value; break;
        }
    }

    @Override
    public boolean isEditable(int index) {
        switch (index) {
            case 0:
            case 1: return false;
            case 2: return true;
            default: return false;
        }
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final LigacaoAtributo other = (LigacaoAtributo) obj;
        if ((this.nomeAux == null) ? (other.nomeAux != null) : !this.nomeAux.equals(other.nomeAux)) {
            return false;
        }
        if ((this.nomeDim == null) ? (other.nomeDim != null) : !this.nomeDim.equals(other.nomeDim)) {
            return false;
        }
        return true;
    }

    public int getCdAux() {
        return cdAux;
    }

    public void setCdAux(int cdAux) {
        this.cdAux = cdAux;
    }

    public int getCdDim() {
        return cdDim;
    }

    public void setCdDim(int cdDim) {
        this.cdDim = cdDim;
    }

    public String getNomeAux() {
        return nomeAux;
    }

    public void setNomeAux(String nomeAux) {
        this.nomeAux = nomeAux;
    }

    public String getNomeDim() {
        return nomeDim;
    }

    public void setNomeDim(String nomeDim) {
        this.nomeDim = nomeDim;
    }

    public boolean isTrans() {
        return trans;
    }

    public void setTrans(boolean trans) {
        this.trans = trans;
    }
}
